package com.wxc.api.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wxc.api.admin.entity.SysUserRoleRelation;
import com.wxc.api.admin.mapper.SysUserRoleRelationMapper;
import com.wxc.api.admin.service.ISysUserRoleRelationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 用户角色关联关系表 服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2022-04-14
 */
@Service
public class SysUserRoleRelationServiceImpl extends ServiceImpl<SysUserRoleRelationMapper, SysUserRoleRelation> implements ISysUserRoleRelationService {

    @Resource
    private SysUserRoleRelationMapper sysUserRoleRelationMapper;

    @Override
    public SysUserRoleRelation getInfo(Integer user_id) {
        QueryWrapper<SysUserRoleRelation> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id", user_id);
        return sysUserRoleRelationMapper.selectOne(wrapper);
    }
}
